import datetime
import random


def random_datetime(start="2018-01-01", end=datetime.date.today().strftime("%Y-%m-%d"), n=1, frmt="%Y-%m-%d"):
    stime = datetime.datetime.strptime(start, frmt)
    etime = datetime.datetime.strptime(end, frmt)
    return [(random.random() * (etime - stime) + stime).strftime("%Y-%m-%d %H:%M:%S") for _ in range(n)]


if __name__ == "__main__":
    print(random_datetime())
